package com.liyuhan.shopping.controller;

import com.alibaba.fastjson.JSONObject;
import com.liyuhan.shopping.dto.DataResponse;
import com.liyuhan.shopping.service.ShoppingCarService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@CrossOrigin
@RequestMapping("/shoppingCar")
public class ShoppingCarController {
    @Autowired
    private ShoppingCarService shoppingCarService;

    @RequestMapping("/add")
    public DataResponse add(@RequestBody JSONObject request){
        return shoppingCarService.add(request);
    }
}
